<template>
	<el-drawer title="查看入驻" v-model="visible" :size="800" destroy-on-close @closed="$emit('closed')">
		<span class="detail-timestamp">最后更新于：{{form.update_time}}</span>
		<el-container v-loading="loading">
			<el-main>
				<el-form>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="企业名称" prop="enterprise_id">{{form.enterprise_id}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="入驻楼宇" prop="building_name">{{form.building_name}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="入驻空间" prop="room">{{form.room}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="租用面积" prop="room_size">{{form.room_size}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="入驻时间" prop="checkin_date">{{form.checkin_date}}</el-form-item>
						</el-col>
					</el-row>
					<el-divider></el-divider>
					<el-row :gutter="24">
						<el-col :lg="12">
							<el-form-item label="有效期至" prop="valid_date">{{form.valid_date}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="联系人" prop="contacts">{{form.contacts}}</el-form-item>
						</el-col>
						<el-col :lg="12">
							<el-form-item label="联系方式" prop="tel">{{form.tel}}</el-form-item>
						</el-col>
					</el-row>
					<el-form-item label="客户经理" prop="account_manager_name">{{form.account_manager_name}}</el-form-item>
				</el-form>
				<el-footer style="text-align: center;">
					<el-button @click="visible=false">关闭</el-button>
				</el-footer>
			</el-main>
		</el-container>
	</el-drawer>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu
	},
	data() {
		return {
			loading: false,
			form: {
				id:'',
				ep_name:'',
				building_name:'',
				room:'',
				room_size:'',
				checkin_date:'',
				valid_date:'',
				contacts:'',
				tel:'',
				account_manager_name:"",
				enterprise_id: ""
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {

	},
	methods: {
		//显示
		open(){
			this.visible = true;
			return this;
		},
		isValid(data){
			if (Object.prototype.toString.call(data) === '[object Undefined]') {
				return false
			}
			if (Object.prototype.toString.call(data) === '[object Null]') {
				return false
			}
			return true
		},
		async setData(data){
			let res = await this.$API.attractinvestment.checkin.getCheckinById.get({id:data.id});
			if(res.code == 200) {
				let data = res.data[0]
				this.form.ep_name = data.ep_name
				this.form.building_name = data.building_name
				this.form.room = data.room
				this.form.room_size = data.room_size
				this.form.checkin_date = data.checkin_date
				this.form.valid_date = data.valid_date
				this.form.contacts = data.contacts
				this.form.tel = data.tel
				this.form.enterprise_id = data.enterprise_id
				this.form.account_manager_name = data.account_manager_name
			}
		},
	}
}
</script>

<style>
.el-drawer__header{
	background-color: #efefef;
}
.el-drawer__title{
	color: #333;
	background-color: #efefef;
	border: 1px solid #ddd;
	border-radius: 3px;
	margin: 0px -40px 0px -48px;
	padding: 0px 0px 15px 60px;
}
.el-drawer__close-btn{
	margin-top: -12px;
}
.detail-timestamp{
    position: absolute;
    right: 40px;
    top: 64px;
    z-index: 100;
    color: #8f8f8f;
    font-size: 13px;
}
</style>
